package com.kzw.misc.utils;

import java.util.HashMap;
import java.util.Map;

import com.kzw.core.mapper.Jackson;

@SuppressWarnings("unchecked")
public class MapUtil {

	/**
	 * 快速创建一个map
	 */
	public static Map<String, Object> newMap(String key, Object value) {
		Map<String, Object> map = new HashMap<>();
		map.put(key, value);
		return map;
	}

	public static Map<String, Object> newMap(String key1, Object value1, String key2, Object value2) {
		Map<String, Object> map = new HashMap<>();
		map.put(key1, value1);
		map.put(key2, value2);
		return map;
	}

	public static Map<String, Object> newMap(String json) {
		return Jackson.me().fromJson(json, Map.class);
	}

}
